agree_diffs = import(here("data","agree_diffs.rds"))

fig_survey_diffs = agree_diffs |> 
  filter(term != "(Intercept)") |> 
  mutate(term = ifelse(term == "inc_grp", "Income", "Education"),
         label = str_remove(policy, "policy_")) |>
  left_join(policies) |> 
  fix_healthcare() |> 
  ggplot(aes(x = estimate, y = reorder(newlabel, estimate), color = term, shape = as.factor(term))) +
  geom_pointrange(aes(xmin = estimate - 1.96*std.error,
                      xmax = estimate + 1.96*std.error),
                  position = position_dodge(.2)) +
  geom_vline(xintercept = 0) +
  labs(x = "Estimate (High Support vs. Low Support)", y = NULL) +
  scale_color_manual(name = "Demographic\nGroup",
                     values = c("darkgreen","blue")) +
  scale_shape_discrete(name = "Demographic\nGroup") +
  theme(legend.position = "bottom") +
  theme_bw()

ggsave(here("figures","appendix","figure_s10.png"), fig_survey_diffs,
       dpi = 600, units = "in", height = 10, width = 8)

ccat("See 'figure_s10.png' for Figure S10 output")